package codeTop;

public class q104 {
    public int maxDepth(TreeNode root) {
        return dfs(root);
    }
    int dfs(TreeNode node){
        if (node == null) {
            return 0;
        }
        return Math.max(dfs(node.left),dfs(node.right))+1;
    }
}
